/* 页面加载时隐藏body内容，只显示加载界面 */
body.loading {
    overflow: hidden;
}

/* 通用加载界面样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-container {
    text-align: center;
    color: white;
    width: 600px;
    height: 560px; /* 增加高度以容纳更高的阶段容器 */
    padding: 40px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.loading-title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    height: 40px;
    flex-shrink: 0;
}

.loading-subtitle {
    font-size: 16px;
    margin-bottom: 30px;
    opacity: 0.9;
    height: 24px;
    flex-shrink: 0;
}

/* 加载阶段容器 */
.loading-stage {
    margin-bottom: 15px;
    text-align: left;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 15px 20px;
    height: 70px; /* 固定高度，防止布局抖动 */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.loading-stage.single-stage {
    margin-bottom: 15px;
    height: 70px; /* 固定高度，防止布局抖动 */
}

.loading-stage.active {
    background: rgba(0, 0, 0, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 阶段头部 */
.stage-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    height: 20px; /* 固定高度 */
    flex-shrink: 0;
}

.stage-icon {
    font-size: 16px;
    margin-right: 8px;
    width: 20px;
    text-align: center;
}

.stage-icon.loading {
    animation: pulse 1s infinite;
}

.stage-icon.completed {
    animation: scaleIn 0.3s ease;
}

.stage-title {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
    opacity: 0.9;
}

.stage-percent {
    font-size: 14px;
    font-weight: 600;
    min-width: 45px;
    text-align: right;
}

/* 阶段进度条 */
.stage-progress-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 6px;
    flex-shrink: 0; /* 防止被压缩 */
}

.stage-progress-bar {
    height: 8px;
    width: 0%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 10px;
    transition: none;
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.8);
    display: block;
    visibility: visible;
    opacity: 1;
}

/* 阶段详情 */
.stage-detail {
    font-size: 12px;
    opacity: 0.7;
    height: 16px; /* 固定高度，防止文字变化导致布局抖动 */
    line-height: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap; /* 单行显示，超出显示省略号 */
    flex-shrink: 0;
}


/* 加载动画 - 旋转圆圈 */
.loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 30px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
    /* 隐藏转圈动画 - 直接显示进度条 */
    display: none !important;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 加载点动画 */
.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* 完成状态 */
.loading-complete-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border: 4px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.loading-complete-text {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 加载项列表 */
.loading-items-list {
    height: 140px; /* 减小高度，避免占用太多空间 */
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 10px;
    text-align: left;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 15px;
    flex-shrink: 0;
    flex-grow: 0;
}

.loading-item {
    padding: 8px 0;
    font-size: 14px;
    opacity: 0.7;
    display: flex;
    align-items: center;
}

.loading-item.loading {
    opacity: 1;
    font-weight: 600;
}

.loading-item.completed {
    opacity: 0.5;
}

.loading-item-icon {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.loading-item.loading .loading-item-icon {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 滚动条样式 */
.loading-items-list::-webkit-scrollbar {
    width: 6px;
}

.loading-items-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.loading-items-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.loading-items-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ========================================
   模型拖拽加载进度条样式
   ======================================== */

.loading-progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.loading-progress-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    max-width: 500px;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.loading-progress-header {
    padding: 20px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.loading-progress-header .loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin: 0;
}

.loading-progress-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.loading-progress-body {
    padding: 25px;
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar-container .progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar-container .progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 8px;
}

.status-text {
    text-align: center;
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 15px;
    min-height: 20px;
}

/* 分类详情容器 */
.category-details {
    margin-top: 15px;
}

.category-item {
    padding: 12px 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.category-item-loading {
    background: #e7f3ff;
    border-left: 3px solid #667eea;
}

.category-loading {
    background: #e7f3ff;
    border-left: 3px solid #667eea;
}

.category-completed {
    background: #d4edda;
    border-left: 3px solid #28a745;
    opacity: 0.85;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.category-loading .category-icon {
    animation: pulse 1s infinite;
}

.category-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.category-count {
    font-size: 13px;
    font-weight: 600;
    color: #667eea;
    padding: 2px 8px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
}

.category-completed .category-count {
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.category-current {
    margin-top: 8px;
    font-size: 12px;
    color: #6c757d;
    padding-left: 34px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

